import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class CBanner extends StatelessWidget {
  List<String> _bannerList = [];

  CBanner(this._bannerList, {Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Container(
        width: 375.w,
        child: CarouselSlider(
      options: CarouselOptions(
        autoPlay: true,
        enlargeCenterPage: true,
        viewportFraction: 0.75,
        aspectRatio: 16/9,
        autoPlayCurve: Curves.fastOutSlowIn,
        scrollDirection: Axis.horizontal,
        initialPage: 2,
      ),

      items: _bannerList
          .map((item) => ClipRRect(
                borderRadius: BorderRadius.circular(10.0),
                child: Center(child: Image.network(item, fit: BoxFit.fill)),
              ))
          .toList(),
    ));
  }
}
